//
//  HHFaceMessageCell.m
//  HHChatKit
//
//  Created by Henry on 2021/6/3.
//

#import "HHFaceMessageCell.h"
#import <HHTool/UIView+HHLayout.h>
#import "HHResources.h"

@implementation HHFaceMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _faceView = [[UIImageView alloc] init];
        _faceView.contentMode = UIViewContentModeScaleAspectFit;
        [self.container addSubview:_faceView];
        _faceView.mm_fill();
        _faceView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    }
    return self;
}

- (void)fillWithData:(HHFaceMessageCellData *)data {
    [super fillWithData:data];
    self.faceData = data;
    _faceView.image = [UIImage imageWithContentsOfFile:data.path];

}

@end
